package com.lanou.beautifulwardrobe.brand;


import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.Log;

import com.lanou.beautifulwardrobe.entify.EditRecommendProduct;

import java.util.List;

/**
 * Created by dllo on 15/10/31.
 */
public class EditViewPager extends FragmentPagerAdapter {

    private List<EditRecommendProduct> datas;

    public void addData(List<EditRecommendProduct> datas) {
        this.datas = datas;
        notifyDataSetChanged();

    }

    public EditViewPager(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        Log.i("lanou",datas.get(position).getDescription()+"*****"+position);
        return new EditFragment(datas, position);
    }

    @Override
    public int getCount() {
        return datas != null && datas.size() > 0 ? datas.size() : 0;

    }
}
